public class QuizCheck
{
   /**
      Checks whether a string of quiz answers is valid. It must 
      contain an answer A, B, C, or D for each expected answer, or an 
      X to indicate that no answer was provided.
      @param input the answer string
      @param questions the number of questions in the string
      @return true if the string was valid, false otherwise
   */
   public static boolean checkInputs(String input, int questions)
   {
      int l = input.length(),k=1;
      if(l==questions){
         for(int i=0;i<l;i++){
            if(input.charAt(i)!='A' && input.charAt(i)!='C' && input.charAt(i)!='D' && input.charAt(i)!='X' && input.charAt(i)!='B'){
               k=0;
            }
            
         }
      }
      else if(l==0)
      k=1;
      else
      k=0;
      return (k==1);
   }
}